package com.sfac.day02.modules.test.service.impl;

import com.sfac.day02.modules.common.entity.ResultBean;
import com.sfac.day02.modules.test.dao.CountryDao;
import com.sfac.day02.modules.test.entity.Country;
import com.sfac.day02.modules.test.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CountryServiceImp implements CountryService {
    @Autowired
    private CountryDao countryDao;
    @Override
    public ResultBean<Country> getCountryByCountryId(int countryId) {
        return new ResultBean<Country>(ResultBean.ResultStatus.SUCCESS.code,"sucess",countryDao.getCountryByCountryId(countryId));
    }

    @Override
    public ResultBean<Country> getCountryByCountryName(String countryName) {
        return new ResultBean<Country>(ResultBean.ResultStatus.SUCCESS.code,"sucess",countryDao.getCountryByCountryName(countryName));
    }
}
